from pymysql import *

conn = Connection(host='localhost',user='root',password='qinxiao123456',database='catmovie',port=3306)

cusror = conn.cursor()


def querysql(sql,params,type='no_select'):
    params = tuple(params)
    cusror.execute(sql,params)

    if type != 'no_select':
        data_list = cusror.fetchall()
        conn.commit()
        return data_list
    else:
        conn.commit()
        return '数据库语句执行成功'

# data = queryhive('select * from catMovieData',[],'select')
#
# print(data[0])